﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String treePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+"/Tree/";
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	String roomName = (String) request.getAttribute("roomName");
	String roomId = (String) request.getAttribute("roomId");
	String time = (String) request.getAttribute("time");
	String year = (String) request.getAttribute("year");
	String month = (String) request.getAttribute("month");
    
	String shangxia = (String) request.getAttribute("shangxia");
	String shijian = "09:00";
	if("PM".equals(shangxia)){
		shijian = "14:00";
	}
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<base href="<%=basePath%>" />
	<title>粮油集团办公自动化系统</title>
	<style type="text/css">
td {
	font: 12px/ 170% "宋体", "新宋体", "黑体";
	color: #000
}

th {
	font: 12px/ 170% "宋体", "新宋体", "黑体";
	color: #000
}

.black_overlays{
			display: none;
			position: absolute;
			top: 0%;
			left: 0%;
			width: 1200px;
			height: 800px;
			background-color: gray;
			z-index:1001;
			-moz-opacity: 0.8;
			opacity:.80;
			filter: alpha(opacity=80);

}

/* 添加任务div样式 */
.ceshi5 {
			    display: none;
				position: absolute;
				top: 25%;
				left: 30%;
				width: 253px;
				height: 235px;
				border: 1px solid #11557B;
				border-bottom: block;
				background-color: #E2F7FF;
				z-index: 1003;
				overflow: auto;
}
</style>
		<link href="<%=basePath%>style/txlz7.css" rel="stylesheet" type="text/css" />
		
		
		<!-- 多系统树 开始 -->
	<link href="<%=basePath %>ajaxFramework/ext-2.1/resources/css/ext-all.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="<%=basePath %>ajaxFramework/ext-2.1/adapter/ext/ext-base.js"></script>
	<script type="text/javascript" src="<%=basePath %>ajaxFramework/ext-2.1/ext-all.js"></script>
	<script type="text/javascript" src="<%=treePath %>ajaxFramework/ext-2.1/adapter/ext/ext-lang-zh_CN.js"></script>
	<script type="text/javascript" src="<%=basePath %>js/common/global/validator.js"></script>
	<script type="text/javascript" src="<%=basePath %>js/common/global/pageControl.js"></script>
	
	<script type="text/javascript" src="<%=basePath %>js/common/system/selectusertreecheck.js"></script>
	<!-- 结束 -->
		
	<jsp:include page="../system/xzdanjs.jsp"></jsp:include>
	<script type="text/javascript" src="<%=basePath %>ajaxFramework/jQuery/jquery.js"></script>
	<script type="text/javascript" src="<%=basePath %>js/My97DatePicker/WdatePicker.js"></script>
	
	<!-- 执行上传文件操作的函数 start-->
	<script type="text/javascript" src="<%=basePath %>js/common/fileUpload/ajaxfileupload.js"></script>
	<script type="text/javascript" src="<%=basePath %>js/common/fileUpload/ajaxFileZx.js"></script>
	<script type="text/javascript">
	var deleteFile;
	var alreadyUploadFile='';
	var uploadUrl='<%=basePath %>tjsinfo/tjsoa/system/ajaxFileUpload.do?method=uploader';
	var deteleFileUrl='<%=basePath %>tjsinfo/tjsoa/system/ajaxFileUpload.do?method=deleted';
	</script>
	<!-- 执行上传文件操作的函数 end-->	
	
		<script type="text/javascript">
		function checkAllTextValid(form)  
		{  
		    //记录不含引号的文本框数量
			var resultTag = 0;  
			//记录所有text文本框数量  
			var flag = 0;  
			for(var i = 0; i < form.elements.length; i ++)  
			{  
			 if(form.elements[i].type=="text")  
			 {  
			     flag = flag + 1;  
			  //此处填写所要过滤的特殊符号  
			  //注意：修改####处的字符，其它部分不许修改.  
			  //if(/^[^####]*$/.test(form.elements[i].value))  
			  if(/^[^\|"'<>]*$/.test(form.elements[i].value)) resultTag = resultTag+1;  
			  else form.elements[i].select();  
			 }  
			}
			//如果含引号的文本框等于全部文本框的值，则校验通过  
			if(resultTag == flag) return true;  
			else 
			{  
			 Ext.MessageBox.alert('提示框',"<nobr>文本框中不能含有<br/> 1 单引号: ' <br/> 2 双引号: \" <br/> 3 竖  杠: | <br/> 4 尖角号: < > <br/><br/>请检查输入！</nobr>");  
			 return false;  
			}  
		} 
		
		// 判断不能为空
		function submitform1(){
			// 判断不能有空格

	        var parten_str = /^\s*$/ ;
	        // 判断正整数

			if(document.form1.meetingName.value == null || document.form1.meetingName.value == ''){
				Ext.MessageBox.alert('提示框','<nobr>请填入会议名称</nobr>');
			}
			else if(parten_str.test(document.form1.meetingName.value)){
			    Ext.MessageBox.alert('提示框','<nobr>会议名称不能为空格</nobr>');
			}
			else if(document.form1.meetingName.value.length>20){
			    Ext.MessageBox.alert('提示框','<nobr>会议名称不能超过20个汉字</nobr>');
			}
			else if(document.form1.starttime.value == ''){
			    Ext.MessageBox.alert('提示框','<nobr>请填入开会时间</nobr>');
			}
			else if(document.form1.approvalPeopleId.value == ''  ){
			    Ext.MessageBox.alert('提示框','<nobr>请选择审核人</nobr>');
			}
			else if(document.form1.meetingPeopleId.value == ''  ){
			    Ext.MessageBox.alert('提示框','<nobr>请选择参会人</nobr>');
			}
			else if(document.form1.content.value != '' &&  document.form1.content.value.length>400){
			    Ext.MessageBox.alert('提示框','<nobr>内容不得大于400字</nobr>');
			}
			else{
				if(document.getElementById('uploadFile').value!= ''){
					Ext.Msg.confirm('系统提示','您有未上传的文件，是否上传？',function(btn){
						if(btn=='yes'){
							ajaxFileUpload();
						}else{
							if(checkAllTextValid(document.form1))document.form1.submit();
						}
					},this);
				}else{
					if(checkAllTextValid(document.form1))document.form1.submit();
				}
			}
		}
	
	function xiaoshiFade(){
		document.getElementById("lightRole").style.display = "none";
	}
	
	function ko(){
		document.getElementById('lightRole').style.display='none';
		document.getElementById("approvalPeopleId").value=document.getElementById("ids1").value;
		document.getElementById("approvalPeople").value=document.getElementById("auditMan1").value;
		document.getElementById("lightRole").style.display = "none";
	}
	
	function gaibian(str){
		document.getElementById("ids1").value = str.split(",")[0];
		document.getElementById("auditMan1").value = str.split(",")[1];
	}
	
	function bianhua(){
		var start = document.form1.starttime.value;
		if(start!=null){
			if(start.split(':')[0].substring(0,1)=='1' && parseInt(start.split(':')[0].substring(1,2))>2){
				document.form1.remarks.value = '下午';
			}else{
				document.form1.remarks.value = '上午';
			}
		}
	}
	window.onload = function(){
		document.getElementById("right").style.height = document.body.clientHeight;
		document.getElementById("tableid").style.height = document.body.clientHeight-60;
		initselectusertreecheck();
		var tb = new Ext.Toolbar(
			{
				height:25
			}
		);
		tb.render('menu');
		tb.add(
	    {
	            text:'确定',
	            iconCls: 'daohang',
	        	handler: function(){
	        		submitform1();
				}
	    },
	    {
	            text:'返回',
	            iconCls: 'daohang',
	        	handler: function(){
	        		window.history.go(-1);
				}
	    }
	    );
		tb.addFill();
	    tb.addText('<img id="windowResize" src="<%=basePath%>images/m_icon05.gif;"><a style="font-weight:bold; color:black;line-height: 22px;">申请会议</a>&nbsp;&nbsp;&nbsp;');
	}
    </script>
	</head>
	<body>
		<jsp:include page="../system/xzdanjsp.jsp"></jsp:include>
		<div id="main">
			<form action="<%=basePath%>tjsinfo/tjsoa/meetingroom/newEmpoly.do" method="post" name="form1">
				<input type="hidden" name="node2" id="node2"/>
				<input type="hidden" name="node" id="node"/>
         	  	<input id="basePath" value="<%=basePath%>" type="hidden"/>
				<input type="hidden" name="roomId" id="roomId" value="<%=roomId %>"/>
				<div id="files" style="display: none;"></div>
				<div id="right">
					<div id="menu" style="padding-top:4px;"></div>
					<table width="100%" border="0" cellspacing="0" cellpadding="0" id="tableid">
						<tr>
							<td valign="top" height="100%">
								<div class="contabwd">
									<table width="80%" height="400" border="0" cellspacing="0" cellpadding="0" align="center">
										<tr>
											<td width="20px;">&nbsp;</td>
											<td width="90%">
												<table border="0" cellspacing="0" cellpadding="0"
													align="left" style="margin-top: 10px; margin-left: 20px">
													<tr>
														<td>
															<table border="0" align="left" cellpadding="0"
																cellspacing="0" class="ttaabb">
																<tr>
																	<td width="30%" align="right">
																		<img src="images/dfdf_03.gif" />
																		&nbsp;所在会议室:
																	</td>
																	<td width="65%">
																		<%=roomName %>
																	</td>
																	<td width="10%">
																		&nbsp;
																	</td>
																</tr>
																<tr>
																	<td width="25%" align="right">
																		<img src="images/dfdf_03.gif" />
																		&nbsp;会议名称:
																	</td>
																	<td width="65%">
																		<input name="meetingName" type="text" size="41"
																			style="border: 1px #C0C0C0 solid; background: #F4F4F4; height: 19px" />
																	</td>
																	<td width="10%">
																		&nbsp;
																	</td>
																</tr>
																<tr>
																	<td align="right">
																		<img src="images/dfdf_03.gif" />
																		&nbsp;开始时间:
																	</td>
																	<td>
																		<input type="text" id="starttime" name="starttime" onfocus="WdatePicker({dateFmt:'HH:mm'})" class="Wdate" value="<%=shijian %>" onchange="bianhua();"/>
																	</td>
																	<td>
																		&nbsp;
																	</td>
																</tr>
																<tr>
																	<td align="right">
																		<img src="images/dfdf_03.gif" />
																		&nbsp;持续时间:
																	</td>
																	<td>
																		<select id="endtime" name="endtime">
																			<option value="1">1</option>
																			<option value="2" selected="selected">2</option>
																			<option value="3">3</option>
																			<option value="4">4</option>
																			<option value="5">5</option>
																			<option value="6">6</option>
																			<option value="7">7</option>
																			<option value="8">8</option>
																			<option value="9">9</option>
																			<option value="10">10</option>
																		</select>小时
																	</td>
																	<td>
																		&nbsp;
																	</td>
																</tr>
																<tr style="display:none;">
																	<td align="right">
																		<img src="images/dfdf_03.gif" />
																		&nbsp;会议时间段:
																	</td>
																	<td>
																		<select id="remarks" name="remarks">
																			<option value="上午" <%if(!"PM".equals(shangxia))out.print("selected"); %>>上午</option>
																			<option value="下午" <%if("PM".equals(shangxia))out.print("selected"); %>>下午</option>
																			<option value="全天">全天</option>
																		</select>
																	</td>
																	<td>
																		&nbsp;
																	</td>
																</tr>
																<tr>
																	<td width="25%" align="right">
																		<img src="images/dfdf_03.gif" />
																		&nbsp;会议审批人:
																	</td>
																	<td width="65%">
																		<input id="approvalPeople" readonly="readonly" name="approvalPeople" type="text" size="41" style="border: 1px #C0C0C0 solid; background: #F4F4F4; height: 19px" />
																		<a href="javaScript:xianshiDan('115','approvalPeopleId','approvalPeople')" ><img src="images/icon100.gif" /></a>
																		<input type="hidden" name="approvalPeopleId" id="approvalPeopleId" value=""/>
																	</td>
																	<td width="10%">
																		&nbsp;
																	</td>
																</tr>
																<tr>
																	<td align="right">
																		<img src="images/dfdf_03.gif" />
																		&nbsp;参会人:
																	</td>
																	<td>
																		<input type="text" name="meetingPeopleName" id="meetingPeopleName" size="80" style="border: 1px #C0C0C0 solid; background: #F4F4F4; height: 19px"/>
																		<a href="javascript:selectusertreecheckwinshow('meetingPeopleId','meetingPeopleName','node')" >
																		<img src="images/icon100.gif" />
																		</a>
																		<input type="hidden" name="meetingPeopleId" id="meetingPeopleId" />
																	</td>
																	<td>
																	</td>
																</tr>
																<tr>
																	<td align="right">
																		<img src="images/dfdf_03.gif" />
																		&nbsp;内容及特殊需要:
																	</td>
																	<td>
																		<textarea name="content" cols="69" rows="10"></textarea>
																	</td>
																	<td>
																		&nbsp;
																	</td>
																</tr>
																<tr style="display: none;">
																	<td align="right">
																		&nbsp;
																	</td>
																	<td>
																		<font color="red">如有下属企业参加请以附件或文字形式注明相关参会人员名单或要求。</font>
																	</td>
																	<td>
																	</td>
																</tr>
																<tr style="display: none;">
																	<td>
																		<img src="<%=basePath %>images/m_icon212.gif" width="67" height="21" />
																	</td>
																	<td>
							                							<span><input type="file" UNSELECTABLE="on"  name="uploadFile" id="uploadFile" size="34" class="textinput" />&nbsp;<a style="cursor: hand" onclick="ajaxFileUpload()"><img src="<%=basePath %>images/scicon.gif" /></a></span>
							                							<div class="sc_listLong"><ul id="uploadList"></ul></div>
																	</td>
																	<td>
																	</td>
																</tr>
																<tr>
																	<th colspan="3">
																		&nbsp;
																	</th>
																</tr>
															</table>
														</td>
													</tr>
												</table>
											</td>
										</tr>
									</table>
								</div>
							</td>
						</tr>
					</table>
				</div>
				<input type="hidden" name="time" value="<%=time%>" />
				<input type="hidden" name="year" value="<%=year%>" />
				<input type="hidden" name="month" value="<%=month%>" />
			</form>
			<div align="center"></div>
		</div>
	</body>
</html>
